<?php

class Exception_CommonXmlSerializable
    extends Exception
    implements XMLSerializable {

    private $sType;

    public function __construct(
    	$sType,
    	$sMessage
    	) {

    	parent::__construct($sMessage);

    	$this->sType = $sType;

	}

	public function getType() {

		return $this->sType;

	}

    public function toXML() {

        return "<error type=\"" . $this->getType() . "\">" . $this->getMessage() . "</error>";

    }

}

?>